Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

script help

Hi,

I have two field i.e. - Invoice Date and Amount, I want this

    

Invoice DateAmountOutput -->Invoice DateAmount
01/01/2015131/01/2015301
02/01/20151128/02/2015581
03/01/20152131/03/2015891
04/01/20153130/04/20151191
05/01/20154101/05/20151201
06/01/20155102/05/20151211
07/01/20156103/05/20151221
08/01/20157104/05/20151231
09/01/20158105/05/20151241
10/01/20159106/05/20151251
11/01/201510107/05/20151261
12/01/201511108/05/20151271
13/01/201512109/05/20151281
14/01/201513110/05/20151291
15/01/201514111/05/20151301
16/01/201515112/05/20151311
17/01/201516113/05/20151321
18/01/201517114/05/20151331
19/01/201518115/05/20151341
20/01/2015191
21/01/2015201
22/01/2015211
23/01/2015221
24/01/2015231
25/01/2015241
26/01/2015251
27/01/2015261
28/01/2015271
29/01/2015281
30/01/2015291
31/01/2015301
01/02/2015311
02/02/2015321
03/02/2015331
04/02/2015341
05/02/2015351
06/02/2015361
07/02/2015371
08/02/2015381
09/02/2015391
10/02/2015401
11/02/2015411
12/02/2015421
13/02/2015431
14/02/2015441
15/02/2015451
16/02/2015461
17/02/2015471
18/02/2015481
19/02/2015491
20/02/2015501
21/02/2015511
22/02/2015521
23/02/2015531
24/02/2015541
25/02/2015551
26/02/2015561
27/02/2015571
28/02/2015581
01/03/2015591
02/03/2015601
03/03/2015611
04/03/2015621
05/03/2015631
06/03/2015641
07/03/2015651
08/03/2015661
09/03/2015671
10/03/2015681
11/03/2015691
12/03/2015701
13/03/2015711
14/03/2015721
15/03/2015731
16/03/2015741
17/03/2015751
18/03/2015761
19/03/2015771
20/03/2015781
21/03/2015791
22/03/2015801
23/03/2015811
24/03/2015821
25/03/2015831
26/03/2015841
27/03/2015851
28/03/2015861
29/03/2015871
30/03/2015881
31/03/2015891
01/04/2015901
02/04/2015911
03/04/2015921
04/04/2015931
05/04/2015941
06/04/2015951
07/04/2015961
08/04/2015971
09/04/2015981
10/04/2015991
11/04/20151001
12/04/20151011
13/04/20151021
14/04/20151031
15/04/20151041
16/04/20151051
17/04/20151061
18/04/20151071
19/04/20151081
20/04/20151091
21/04/20151101
22/04/20151111
23/04/20151121
24/04/20151131
25/04/20151141
26/04/20151151
27/04/20151161
28/04/20151171
29/04/20151181
30/04/20151191
01/05/20151201
02/05/20151211
03/05/20151221
04/05/20151231
05/05/20151241
06/05/20151251
07/05/20151261
08/05/20151271
09/05/20151281
10/05/20151291
11/05/20151301
12/05/20151311
13/05/20151321
14/05/20151331
15/05/20151341

  

24 Replies
Gysbert_Wassenaar

Load [Invoice Date], Amount

From ...source....

Where floor([Invoice Date]) = floor(monthend([Invoice Date]));


talk is cheap, supply exceeds demand
buzzy996
Master II
Master II

PFA,but u can try for some better expression as well.

petter
Partner - Champion III
Partner - Champion III

This might be exactly want you are looking for - Need a calculated dimension with an If() :

2015-05-15 #1.PNG

sona_sa
Creator II
Creator II

Hi Petter,

I need the same in script.

  1. 1. Suppose I have 6 month data from 1st Jan 2015 to 1 July 2015 with amount. Then I want from Jan to May 2015, the day will come for end of the month date. Like 31st Jan, 28th Feb, 31 Mar, 30th Apr and 31st May. And for June month entire date will come, for 1st July 2015 will not come. 

  1. 2. But if 2nd July is available then 31st Jan, 28th Feb, 31 Mar, 30th Apr, 31st May, 30th June, 1st July and 2nd July will be there. Similarly, it will continue and till 30 it will continue again for next month when 1st will come then again point 1 will apply.

Thanks for Reply.

sona_sa
Creator II
Creator II

Hi Gysbert,


It will give every monthend date. But requirement is like this.

I need the same in script.

1. Suppose I have 6 month data from 1st Jan 2015 to 1 July 2015 with amount. Then I want from Jan to May 2015, the day will come for end of the month date. Like 31st Jan, 28th Feb, 31 Mar, 30th Apr and 31st May. And for June month entire date will come, for 1st July 2015 will not come. 

2. But if 2nd July is available then 31st Jan, 28th Feb, 31 Mar, 30th Apr, 31st May, 30th June, 1st July and 2nd July will be there. Similarly, it will continue and till 30 it will continue again for next month when 1st will come then again point 1 will apply.


Thanks for reply and sorry I did not check that, so i have applied 2 times. It was not my intention.

manojkulkarni
Partner - Specialist II
Partner - Specialist II

can do a group by on date field.

Load max(datefield), amount resident table group by datefield

sona_sa
Creator II
Creator II

Max function will return max date of every month.

Giving you a example :

For fiscal year  Jan to current month - May is going. today is 15 - May 2015.

I want from Jan to April it should to return monthend date and for current month may 1st to 14th May date will also return.



Gysbert_Wassenaar

Ok, you're forgiven

But please have a bit more patience in the future.

See attached qvw for a script based solution.


talk is cheap, supply exceeds demand
sona_sa
Creator II
Creator II

Hi Gysbert,

Thanks for reply.

Please find the attached qvw. In the same scenerio if 1st June is coming it is stoping and returning me for Jan to May monthend date.

But output will be - From Jan to Apr - Monthend date of jan / feb / march / apr and for may month from 1st to 31st date will come and for June no date will come. But suppose 2nd june or so on date is coming,

From Jan to May - monthend date but for June till date data will be available.

Thanks Again.