Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month vs Quarter

Hi, guys!

I have a tricky problem here. I have a pivot table as follows:

 

MonthsQ1Q2Q3
BG_benchBench, USDBench, USDBench, USD
Engineering30,86400
Genesys000
International Other000
Kyivstar000
Lindorff000
Telecom000
Ukraine other000
Total30,86477,420180,906

I have a condition for Becnch USD calculation depending on the period, if it is > or < than current month

My expression:

IF(Month_Date>=(vCurMonth),Sum(Sal*Bench_Data),Sum({<Y={'2015'}>}Fact_bench))

However when it comes to quarters it doesnt give me the desired result.

The quarters are in the same table with Month_Date in my load script.

Thnx!

1 Solution

Accepted Solutions
Not applicable
Author

maybe this will work?

IF(min(Month_Date)>=(vCurMonth),Sum(Sal*Bench_Data),Sum({<Y={'2015'}>}Fact_bench))

View solution in original post

7 Replies
Anonymous
Not applicable
Author

it would be great if you can share sample qvw

mohammadkhatimi
Partner - Specialist
Partner - Specialist

Hi...Diana...

Please post a sample application...

Regards,

Mohammad.

PrashantSangle

Hi,

Try with below expression,

IF(Month_Date>=(vCurMonth),Sum({<Month_Date={">$(=vCurMonth)"}>} Sal*Bench_Data),Sum({<Y={'2015'},Month_Date={">$(=vCurMonth)"}>}Fact_bench))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi,

Unfortunately, this doesnt work

Not applicable
Author

Hi, 

How can I add a document here? cant find a button

Not applicable
Author

maybe this will work?

IF(min(Month_Date)>=(vCurMonth),Sum(Sal*Bench_Data),Sum({<Y={'2015'}>}Fact_bench))

Anonymous
Not applicable
Author

on right top of reply box see blue link use advanced editor click that and then on right bottom you will get link to attach files