Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

To Add Calculated field on the basis of Existing fields

Hi,

I am new on Qlikview, I want to add one Calculated field on the basis of existing fields.

I have fields (1-sep , 2-Sep, 3-Sep, 4-Sep .....30-Sep)

I want to add One field (Yesterday Date) & If yesterday Date is matching with any of the Field then it should take Data of that field only.

Please help.

Thanks,

Narsingh

4 Replies
Not applicable
Author

Help Anyone please....

MayilVahanan

HI

Load * ,if(date(today()-1,'DD-MMM') = DateField, 1 ,0 ) as FieldName from table;

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks for reply...

But I have Date field in Column Headers as

Name     12-Oct     13-Oct     14-Oct     15-Oct     16-Oct

A               x               y               z               p          q         

B               p               z               y               x          q    

C               y               x               z               q          p

And I want Data of that Column where "Date" is Yesterday...

MayilVahanan

HI

Try like this

crossTest:

CrossTable(CrossDate,CrossValue)

Load * Inline

[

Name,12-Oct,13-Oct,14-Oct,15-Oct,16-Oct

A,x,y,z,p,q  

B,p,z,y,x,q   

C,y,x,z,q,p

];

Load *, if(date(today()-1,'DD-MMM') = CrossDate, CrossValue ,0 ) as reqValue Resident crossTest;

Drop Table crossTest;

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.