Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've a different number of fields from qvd file. Along this fields i'm creating new fields with calculation. Again i'm using the newly create fields in resident load and based on the calculation of this fields again creating new fields. But, now i want to see exact result in the table box . How can i combine this fields in proper manner.
For Eg:
Table1:
Load A,
B,
if(C<>23,C) as C1
From Table1.qvd;
Table2:
Load
if(Len(C1)>0,C1) as C2
Resident Table1;
- Now, when i load A,B,C1 in one table box. I can see exact data what i retrived from qvd file.
- But if i load A,B,C1,C2 in table box then i want to see exact data how it is loaded(i.e 1 by 1 loading Table1.qvd) qvd file.
- With what keyword i can make relationship to this tables.
Hi,
You can do that in only one table, do you really need two tables for that? Check the following script
Table1:
LOAD A,
B,
If(C <> 23, C) as C1,
If(Len(If(C <> 23, C)) > 0, If(C <> 23, C)) AS C2 // replacing the equivalent to C1 used in the field above
From Table1.qvd;
Hope that helps.
BI Consultant
Hi,
You can try this.
Table1:
Load A,
B,
if(C<>23,C) as C1
From Table1.qvd;
Table2:
Load
A,
if(Len(C1)>0,C1) as C2
Resident Table1;
Regards,
Kaushik Solanki
Hi,
You can try this.
Table1:
Load A,
B,
if(C<>23,C) as C1
From Table1.qvd;
left join(Table1)
Load
A,
if(Len(C1)>0,C1) as C2
Resident Table1;
this will give u fast access even in complx scenario
Hi,
You can do that in only one table, do you really need two tables for that? Check the following script
Table1:
LOAD A,
B,
If(C <> 23, C) as C1,
If(Len(If(C <> 23, C)) > 0, If(C <> 23, C)) AS C2 // replacing the equivalent to C1 used in the field above
From Table1.qvd;
Hope that helps.
BI Consultant
Thanks a lot for all....
Miguel,
In if loop why we need to check conditon again. we can write like this also know.
Table1:
LOAD A,
B,
If(C <> 23, C) as C1,
If(Len(If(C <> 23, C)) > 0, C) AS C2 // replacing the equivalent to C1 used in the field above
From Table1.qvd;
Yes, that will be cleaner. Say the value for field C in the current record is "4". C1 is equal to 4, and C2 qwill be equal to 4 as well, because Len(4) > 0 returns true. Say now that the value is "23". C1 is equal to null() (there is no "else" part in the If() condition). C2 will be null as well, because it will enter the "else" part of the if, and since there is nothing specified, null() is returned.
Hope that makes sense.
BI Consultant
Hello,
ya what you said is correct. There is no else part so it returns null in both cases(c1,c2).
Thanks buddy..