Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Giselle100
Contributor III
Contributor III

Qliksense Expression

I have the below expression

If(Match(([Grv1 Date]-[In DC Date]),1,2,3,4,5,6,7),'1-7 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),8,9,10,11,12,13,14),'8-14 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),15,16,17,18,19,20,21),'15-21 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),22,23,24,25,26,27,28),'22-28 Days Late',
If(Match(([Grv1 Date]-[In DC Date]),0,-1,-2,-3,-4,-5,-6,-7),'On Time',
If(Match(([Grv1 Date]-[In DC Date]),-8,-9,-10,-11,-12,-13,-14),'More than 7 Days Early',
If(Match(([Grv1 Date]-[In DC Date]),-15,-16,-17,-18,-19,-20,-21),'More than 14 Days Early',
If(Match(([Grv1 Date]-[In DC Date]),-22,-23,-24,-25,-26,-27,-28),'More than 21 Days Early',
'28 Days Late'))))))))

I need to replace ([Grv1 Date]-[In DC Date]) in above expression with if([Grv1 Date],([In DC Date]-[Grv1 Date]),([In DC Date]-[Grv2 Date]))

Labels (2)
2 Replies
sunny_talwar

Try this may be

If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),1,2,3,4,5,6,7),'1-7 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),8,9,10,11,12,13,14),'8-14 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),15,16,17,18,19,20,21),'15-21 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),22,23,24,25,26,27,28),'22-28 Days Late',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),0,-1,-2,-3,-4,-5,-6,-7),'On Time',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),-8,-9,-10,-11,-12,-13,-14),'More than 7 Days Early',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),-15,-16,-17,-18,-19,-20,-21),'More than 14 Days Early',
If(Match(([In DC Date] - Alt([Grv1 Date], [Grv2 Date])),-22,-23,-24,-25,-26,-27,-28),'More than 21 Days Early',
'28 Days Late'))))))))

Giselle100
Contributor III
Contributor III
Author

Thank you, works perfectly.