I'm trying to filter data from a week beginni...

(Joel Lisbona) #1

I’m trying to filter data from a week beginning on monday and ending on sunday instead of sunday to saturday?

I’m trying WEEKNUM([Data]) = WEEKNUM(TODAY()) but this expression consider the week beginning on sunday. I tryed other logics but couldn’t found a solution.

In Google Sheets we use “type 2” to do that “WEEKNUM(Date; 2)”, but i couldn’t find a way to do that in AppSheet.

Any suggestion?Thanks!

(Bjoern Houlberg) #2

Hi @Joel_Lisbona

Im using =WEEKNUM(Today()-1), to get the weeknum im use to.


(Joel Lisbona) #3

@Bjoern_Houlberg Hi, thanks, in fact i tried that way before, but the problem is that method doesn’t show data from sunday, it shows correctly begining on monday but stops on saturday.

(Aleksi Alkio) #4

Well you have that same problem because you are using the expression on the app WEEKNUM(TODAY()-1). You should find a way for your evaluation to find both WEEKNUMs directly from your gSheet.

(Joel Lisbona) #5

@Aleksi_Alkio I think it was a cache issue, this morning everything is working correctly, according to the result in the expression assistant the formula is right, but i don’t know why the slice was using another rule or something, as i said, i think it was a browser cache or something, yesterday i did try some refreshs and syncs without success, today everything is fine till now, thanks!

(Aleksi Alkio) #6

Glad you found a way:-)

(Bjoern Houlberg) #7

@Joel_Lisbona Ah sorry didn’t know that. We only run production Monday - Saturday so guess that’s why I haven’t seen any issues. Let me know if you find a solution.

(Joel Lisbona) #8

No problem, i’m still working on a solution for that…a little bit frustating, but i don’t wanna give up, Lol.Thanks!

(Aleksi Alkio) #9

Why don’t you use it as a sheet formula?

(Joel Lisbona) #10

I don’t know If i understood your suggestion, but i need to apply that

fórmula on a slice. Are you suggesting to apply the formula just like i would use on a Google sheet? WEEKNUM(Cell; 2) if It is your suggestion i tried before but Appsheet doesn’t accept putting that type configuration on WEEKNUM command.

(Aleksi Alkio) #11

Add that formula directly into the gSheet and it will calculate the result. When you have added that formula, you need to regerate your table structure.

(Joel Lisbona) #12

Ok, will try to find a way to do It like your suggestion and maybe comparing that result with the result formula in the condition of the slice to filter the way i want.

(Joel Lisbona) #13

@Aleksi_Alkio Your suggestion worked very well, i created a column in my gSheet table to get the week number beginning on monday =WEEKNUM(DATECELL;2) and then in the appsheet slice a i put the condition [weeknumberfromgsheet] = WEEKNUM(TODAY()-1)…thanks for the help Aleksi and @Bjoern_Houlberg

(Joel Lisbona) #14

In fact, the calculation works well in the Expression assistant, but if a click on “View Data” in the slice that have the formula, just show the data from the next week, so i’m half the way again.