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: 
smilingjohn
Specialist
Specialist

Variable

HI

I have two variable one variable has vStartDate and  another is vEndDate

Now i have to display the value in two text box

value for start date And iam trying to use this formula but iam geting a dash symbol

if(Date=vStartDate ,sum(netAmount))

if(Date=vENdDate ,sum(netAmount))


Can plz some one correct the expression ?

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi John,

Please check the attachment. You can mention start date and end date in input box. Based on that the two text boxes will display the sum values.

Capture.PNG

Let me know if you have any clarifications !.

View solution in original post

11 Replies
hic
Former Employee
Former Employee

"Date" is a naked field reference and will be evaluated to NULL, since there are several possible values.

See Use Aggregation Functions!

HIC

SreeniJD
Specialist
Specialist

Try this -

If(Min(Date(DateField))=vStartDate,Sum(netAmount))

If(Max(Date(DateFIeld))=vEndDate,Sum(netAmount))

Sreeni

tamilarasu
Champion
Champion

Hi John,

Could you post your expected output (I could see you are struggling to get the final result).? If we know your full expectation, we can guide you to achieve final output in one go.!!

smilingjohn
Specialist
Specialist
Author

Hi Nagraj

Its the same file u sent me after modifying , My requirement is like i want to show a sum of value for perticular SBU and location only for start date

and another text object which  should show the value for end date .

i hope iam clear .

tamilarasu
Champion
Champion

If the dates (in your case PERIOD_START_DATE and SCHEDULE_CLOSE_DATE ) are falls between start date and end date, you need to show the sum value. Right?

If you mention the start date as 01.12.2013 and end date as 31.12.2013, the textbox should display the sum value (PERIOD_START_DATE and SCHEDULE_CLOSE_DATE falls inbetween the start date and end date).

Correct me, If I am wrong.

Anonymous
Not applicable

if(Date=vStartDate ,sum(netAmount))

Date is an internal function and Need a Parameter

hwat date do you want to compare? today, specific date?

then try

if (today()=vStartDate,...

or

if (date(mydate)=vStartDate,...

Digvijay_Singh

try -

Sum(if(Date=vStartDate ,netAmount))

Sum(if(Date=vENdDate ,netAmount))

smilingjohn
Specialist
Specialist
Author

Actaully i need to show a text objec which shoul show the sum(value) for PERIOD_START_DATE

and one more text object which should show me SUm(value) for SCHEDULE_CLOSE_DATE.

and also please if u can just let me know , how do i implement this in charts expression , i just want to pass this value

tamilarasu
Champion
Champion

Ok got it. I'll check