Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Set Expression

Hi,

I have calculated Budget in my QV document with following expression

sum( {<NOTE = {'SALES'}>}[BUDGET] )

Now I want to increase this budget by 5% effective from the month of march. My current budget and revised amount is shown below

JanFebMarAprMayJunJulAugSepOctNovDec
Budget100010001000100010001000100010001000100010001000
Revised Budget100010001050105010501050105010501050105010501050

I want to rewrite the expression where budget should only be increased 5 % with effect from Mar onward

Pls let me how to modify the above expression

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

LOAD *, MONTH(DATE#(MONTH, 'MMM')) AS MONTHNAME INLINE [

    MONTH, Budget, REVISED_BUDGET,

    JAN, "4,125,000", "4,331,250",

    FEB, "4,025,000", "4,025,000",

    MAR, "4,225,000", "4,436,250",

    APR, "3,445,000", "3,445,000",

    MAY, "4,225,000", "4,436,250",

    JUN, "4,225,000", "4,436,250",

    JUL, "5,125,000", "5,381,250",

    AUG, "5,225,000", "5,225,000",

    SEP, "5,725,000", "6,011,250",

    OCT, "5,625,000", "5,906,250",

    NOV, "5,350,000", "5,617,500",

    DEC, "5,353,000", "5,353,000"

];

MONTHNAME Original Revised
56673000 56673000
Jan41250004125000
Feb40250004025000
Mar42250004436250
Apr34450003617250
May42250004436250
Jun42250004436250
Jul51250005381250
Aug52250005486250
Sep57250006011250
Oct56250005906250
Nov53500005617500
Dec53530005620650

Revised  = If(MONTHNAME > 2, sum( [Budget] ) + (sum( [Budget] ) *0.05), sum( [Budget] ))

original = Sum(Budget)

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

View solution in original post

3 Replies
MayilVahanan

HI

Try like this

= If(Month> 'Feb', sum( {<NOTE = {'SALES'}>}[BUDGET] ) + (sum( {<NOTE = {'SALES'}>}[BUDGET] ) *0.05), sum( {<NOTE = {'SALES'}>}[BUDGET] ))

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

THANKS

When I apply your expression it does not work for some months

eg:JAN,APR,AUG,DEC

Pls refer Attachment below

MONTHBudgetREVISED_BUDGET
JAN4,125,0004,331,250
FEB4,025,0004,025,000
MAR4,225,0004,436,250
APR3,445,0003,445,000
MAY4,225,0004,436,250
JUN4,225,0004,436,250
JUL5,125,0005,381,250
AUG5,225,0005,225,000
SEP5,725,0006,011,250
OCT5,625,0005,906,250
NOV5,350,0005,617,500
DEC5,353,0005,353,000
Total56,673,00056,673,000
MayilVahanan

Hi

Try like this

LOAD *, MONTH(DATE#(MONTH, 'MMM')) AS MONTHNAME INLINE [

    MONTH, Budget, REVISED_BUDGET,

    JAN, "4,125,000", "4,331,250",

    FEB, "4,025,000", "4,025,000",

    MAR, "4,225,000", "4,436,250",

    APR, "3,445,000", "3,445,000",

    MAY, "4,225,000", "4,436,250",

    JUN, "4,225,000", "4,436,250",

    JUL, "5,125,000", "5,381,250",

    AUG, "5,225,000", "5,225,000",

    SEP, "5,725,000", "6,011,250",

    OCT, "5,625,000", "5,906,250",

    NOV, "5,350,000", "5,617,500",

    DEC, "5,353,000", "5,353,000"

];

MONTHNAME Original Revised
56673000 56673000
Jan41250004125000
Feb40250004025000
Mar42250004436250
Apr34450003617250
May42250004436250
Jun42250004436250
Jul51250005381250
Aug52250005486250
Sep57250006011250
Oct56250005906250
Nov53500005617500
Dec53530005620650

Revised  = If(MONTHNAME > 2, sum( [Budget] ) + (sum( [Budget] ) *0.05), sum( [Budget] ))

original = Sum(Budget)

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