Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys:
I have a very simple question but not able to get the answer hope that you guys can help.
In Qlikviw when we select the Year, Month and Day for sale we will be getting the transaction for that particular day. For example: - Year 2011 Month 8 and Day 8 we will get the transaction $200.
If we want the sale from 1-8 of August which is the beginning of the month to the selected day. How can I do that?
Sorry for such a simple question and hope that the solution will be simple too by the way I can not use the set analysis function.
Thanks Guys
Hi Qliksus and Abhinava and Guys:
Thanks for both of your solution.
I have a small issue with the Expression that both suggestions.
My Create From Expression is:-
sum (if (invtype='40',goodqty)) + sum (if (invtype='20',goodqty))
And Crate To Expression is :-
sum (if (invtype='42',goodqty)) + sum (if (invtype='34',goodqty))
I am trying to put these expressions into the Edit script but it does not seem to be getting it correct.
So that I will be able to get CrateFrom and CrateTo in order to use the expression that you suggested.
Any idea in putting these expressions into the Edit script?
Sorry for the late reply guys…
Hi richard,
i believe sum() function does not work in script.. I m checking on examples how to implement ur logic.
Rgrds,
Abhinava
Hi Abhinava:
That is what I was thinking because no matter how I try in the script with Sum function and also Sum(if) function it just won't work.
Thanks you for your reply.
Will wait for your good news
Hi richard,
Well gud news is that sum does work in script! you'l hv to use the "group by" clause on the field you want the sum to be calculated by....
I think you should implement the sum on front end rather than in script..
Rgrds,
Abhinava
Hi,
Please see the attached sample may help you.
Cheers.
Hi Abhinava and BlackRockS:
Thanks fo your reply.
If i can not inculde the sum inside the script but has to do it in the front end.
Can I use the following Expression?
Sum(if(Date<=SelDate,CrateFrom))
sum (if (invtype='40',goodqty)) + sum (if (invtype='20',goodqty))
To As follows:-
Sum(if(Year = year(CurrentDate) and Month1 = month(CurrentDate)
and [Inv. Date] <= CurrentDate, (invtype='40',goodqty)) + sum (if (invtype='20',goodqty))
It seems like there is something wrong with the following Expression...
Headach man....
Hi,
See if this can help you.
Sum(if(Year = year(CurrentDate) and Month1 = month(CurrentDate) and [Inv. Date] <= CurrentDate and (invtype=40 or invtype=20),goodqty))
Cheers.
Hi Richard,
i think wht u r trying to do is this...
Sum(if((Year = year(CurrentDate)) and (Month1 = month(CurrentDate)) and ([Inv. Date] <= CurrentDate) and (invtype='40' or invtype='20'),goodqty))
Rgrds,
Abhinava
Hi BlackRockS, Abhinava and Guys:
You all ROCKS and very helpful persons.
I never expect such a good reply from you guys… Once again you thank you guys.
The following should be written in the Expression right?
Sum(if((Year = year(CurrentDate)) and (Month1 = month(CurrentDate)) and ([Inv. Date] <= CurrentDate) and (invtype='40' or invtype='20'),goodqty))
And for the Year and Month I should write in the Edit Script right?
The following is from my script for the Year and Month.
Please comment if I got it wrong:-
LOAD
transdate,
Day(transdate) as Transday,
Year(transdate) as Year,//Because of syn$
month (transdate) as monthdes, //will be in Jan,Feb, Format
num(Month(transdate)) as month,
num(Month (transdate)) as Month1,
invtype,
goodqty,
May I know how to get the Year and year and also the Month1 and month.
For the [Inv.Date] I should be using [transdate] right?
Sorry to ask so many simple questions.
Hi Richard,
i didnt get your question...
"May I know how to get the Year and year and also the Month1 and month?"
For the [Inv.Date], you should probably use [transdate]. you should check in the source what dates fields are avalaible.
Cheers,
Abhinava
P.S- thanx for the accolades